package com.wego.service.impl;

import com.github.pagehelper.Page;
import com.wego.common.base.impl.BaseServiceImpl;
import com.wego.common.bean.PageBean;
import com.wego.entity.domain.LoginLog;
import com.wego.entity.query.LoginLogQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wego.mapper.LoginLogMapper;
import com.wego.service.LoginLogService;

import java.util.List;

@Service
public class LoginLogServiceImpl extends BaseServiceImpl<LoginLog> implements LoginLogService {

    @Autowired
    private LoginLogMapper loginLogMapper;

    @Override
    public PageBean<LoginLog> selectPage(LoginLogQuery loginlogQuery) {
        //设置分页信息
        Page<LoginLog> page = loginlogQuery.toPage();
        //查询数据
        List<LoginLog> loginLogs = loginLogMapper.selectList(loginlogQuery);
        System.out.println("loginlogQuery = " +loginLogs.toString());
        //将MyBatis提供的Page对象转换成我们自己的PageBean对象
        return new PageBean<>(page);
    }


}
